package com.fay.mymiaosha.service.model;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/15 20:43
 * @Version 1.0
 */
@Setter
@Getter
public class ItemModel {
    private Integer id;

    @NotBlank(message = "商品名称不能为空")
    private String title;

    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格必须大于0")
    private BigDecimal price;

    @NotNull(message = "库存不能不填")
    private Integer stock;

    @NotBlank(message = "商品描述信息不能为空")
    private String description;

    // 非入参范围，统计出来的
    private Integer sales;

    @NotBlank(message = "图片信息不能为空")
    private String imgUrl;

    private PromoModel promoModel;
}
